

package com.hazelcast.console;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;

/**
 * A {@link LineReader} implementation.
 */
class DefaultLineReader implements LineReader {

    private final BufferedReader in;

    DefaultLineReader() {
        in = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
    }

    @Override
    public String readLine() throws Exception {
        return in.readLine();
    }

    @Override
    public void close() throws IOException {
        in.close();
    }
}
